<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <%--<meta charset="UTF-8">--%>
    <meta http-equiv="x-ua-compatible" content="text/html; charset=utf-8"/>
    <base href="<%=request.getContextPath() + "/"%>">
    <title>韩顺平教育-家居网购</title>
    <!-- 移动端适配 -->
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
    <link rel="stylesheet" href="assets/css/vendor/vendor.min.css"/>
    <link rel="stylesheet" href="assets/css/plugins/plugins.min.css"/>
    <link rel="stylesheet" href="assets/css/style.min.css">
        <script type="text/javascript" src="script/jquery-3.6.0.min.js"></script>
        <script type="text/javascript">

            $(function () {//页面加载完毕后执行function
                //绑定点击事件 => 忘记的去看jquery
                $("#but").click(function () {

                    // //获取到到输入的家居名 => 自己看前端给的页面
                    // var nameVal = $("#name").val();
                    // //alert("nameVal=" + nameVal)
                    //
                    // //编写正则表达式来进行验证.
                    // var namePattern = /^[\u4e00-\u9fa5]+$/;
                    // //验证
                    // if (!namePattern.test(nameVal)) {
                    //     //展示错误提示, jquery属性过滤器
                    //     $("span[class='errorMsg']").text("家居名格式不对, 需要全为中文字符");
                    //     return false;//不提交 , 返回false
                    // }
                    //
                    // //一关一个关的通过验证
                    // //完成对制造商的校验
                    // var makerVal = $("#maker").val();
                    // var makerPattern = /^[\u4e00-\u9fa5]+$/;
                    // if (!makerPattern.test(makerVal)) {
                    //     //展示错误提示-基本过滤器, 希望小伙伴感到知识不是每个都是新
                    //     //信心-》潜意识我学过.
                    //     $("span.errorMsg").text("制造商格式不对, 需要全为中文字符");
                    //     return false;
                    // }
                    //
                    // //完成对价格的校验
                    // var priceVal = $("#price").val();
                    // var pricePattern = /^[0-9]+\.[0-9][0-9]$/;
                    // if (!pricePattern.test(priceVal)) {
                    //     $("span.errorMsg").text("价格格式不对, 应形如168.99");
                    //     return false;
                    // }
                    // //验证销量
                    // var salesVal = $("#sales").val();
                    // //老师说明 在java中，正则表达式的转义是\\, 在js 正则表达式 转义是\
                    // //如果你看不懂，回看java正则表达式
                    // var salesPattern = /^[0-9]+$/; //偷懒->java
                    // if (!salesPattern.test(salesVal)) {
                    //     $("span.errorMsg").text("销量格式不对，应为无符号整数");
                    //     return false;
                    // }
                    //
                    // //验证库存
                    // var stockVal = $("#stock").val();
                    // //老师说明 在java中，正则表达式的转义是\\, 在js 正则表达式 转义是\
                    // //如果你看不懂，回看java正则表达式
                    // var stockPattern = /^[0-9]+$/; //偷懒->java
                    // if (!stockPattern.test(stockVal)) {
                    //     $("span.errorMsg").text("库存格式不对，应为无符号整数");
                    //     return false;
                    // }
                    //
                    //
                    // //到这里就全部过关. => 我们暂时不提交，显示验证通过信息
                    // $("span.errorMsg").text("验证通过...");
                    // //目前我们写了后台，当验证通过时，就提交给后台
                    return true;

                })

            })
        </script>
</head>

<body>
<!-- Header Area start  -->
<div class="header section">
    <!-- Header Top  End -->
    <!-- Header Bottom  Start -->
    <div class="header-bottom d-none d-lg-block">
        <div class="container position-relative">
            <div class="row align-self-center">
                <!-- Header Logo Start -->
                <div class="col-auto align-self-center">
                    <div class="header-logo">
                        <a href="index.html"><img src="assets/images/logo/logo.png" alt="Site Logo"/></a>
                    </div>
                </div>
                <!-- Header Logo End -->

                <!-- Header Action Start -->
                <div class="col align-self-center">
                    <div class="header-actions">

                        <!-- Single Wedge Start -->
                        <div class="header-bottom-set dropdown">
                            <a href="manage/furnServlet">家居管理</a>
                        </div>
                        <div class="header-bottom-set dropdown">
                            <a href="#">订单管理</a>
                        </div>
                    </div>
                </div>
                <!-- Header Action End -->
            </div>
        </div>
    </div>
    <!-- Header Bottom  End -->
    <!-- Header Bottom  Start 手机端的header -->
    <div class="header-bottom d-lg-none sticky-nav bg-white">
        <div class="container position-relative">
            <div class="row align-self-center">
                <!-- Header Logo Start -->
                <div class="col-auto align-self-center">
                    <div class="header-logo">
                        <a href="index.html"><img width="280px" src="assets/images/logo/logo.png" alt="Site Logo"/></a>
                    </div>
                </div>
                <!-- Header Logo End -->
            </div>
        </div>
    </div>
    <!-- Main Menu Start -->
    <div style="width: 100%;height: 50px;background-color: black"></div>
    <!-- Main Menu End -->
</div>
<!-- Cart Area Start -->
<span class="errorMsg" style="float: right; font-weight: bold; font-size: 20pt; margin-left: 10px;"></span>
<div class="cart-main-area pt-100px pb-100px">
    <div class="container">
        <h3 class="cart-page-title">家居后台管理-添加家居</h3>

        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12 col-12">

                <form action="manage/furnServlet" method="post">
                    <input type="hidden" name="pageNo" value="${param.pageNo}">
                    <div class="table-content table-responsive cart-table-content">
                        <table>
                            <thead>
                            <tr>
                                <th>图片</th>
                                <th>家居名</th>
                                <th>商家</th>
                                <th>价格</th>
                                <th>销量</th>
                                <th>库存</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td class="product-thumbnail">
                                    <a href="#"><img class="img-responsive ml-3" src="assets/images/product-image/default.jpg"
                                                     alt=""/></a>
                                </td>
                                <td class="product-name"><input id="name" name="name" style="width: 60%" type="text" value="Name"/></td>
                                <td class="product-name"><input id="maker" name="maker" style="width: 90%" type="text" value="蚂蚁家居"/></td>
                                <td class="product-price-cart"><input id="price" name="price" style="width: 90%" type="text" value="60.00"/></td>
                                <td class="product-quantity">
                                    <input id="sales" name="sales" style="width: 90%" type="text" value="100"/>
                                </td>
                                <td class="product-quantity">
                                    <input id="stock" name="stock" style="width: 90%" type="text" value="80"/>
                                </td>
                                <td>
<!--                                    <a href="#"><i class="icon-pencil"></i></a>-->
<!--                                    <a href="#"><i class="icon-close"></i></a>-->
                                    <input type="hidden" name="action" value="add">
                                    <input id=but type="submit" style="width: 90%;background-color: silver;border: silver;border-radius: 20%;" value="添加家居"/>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!-- Cart Area End -->

<!-- Footer Area Start -->
<div class="footer-area">
    <div class="footer-container">
        <div class="footer-top">
            <div class="container">
                <div class="row">
                    <!-- Start single blog -->
                    <!-- End single blog -->
                    <!-- Start single blog -->
                    <div class="col-md-6 col-sm-6 col-lg-3 mb-md-30px mb-lm-30px" data-aos="fade-up"
                         data-aos-delay="400">
                        <div class="single-wedge">
                            <h4 class="footer-herading">信息</h4>
                            <div class="footer-links">
                                <div class="footer-row">
                                    <ul class="align-items-center">
                                        <li class="li"><a class="single-link" href="about.html">关于我们</a></li>
                                        <li class="li"><a class="single-link" href="#">交货信息</a></li>
                                        <li class="li"><a class="single-link" href="privacy-policy.html">隐私与政策</a></li>
                                        <li class="li"><a class="single-link" href="#">条款和条件</a></li>
                                        <li class="li"><a class="single-link" href="#">制造</a></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- End single blog -->
                    <!-- Start single blog -->
                    <div class="col-md-6 col-lg-2 col-sm-6 mb-lm-30px" data-aos="fade-up" data-aos-delay="600">
                        <div class="single-wedge">
                            <h4 class="footer-herading">我的账号</h4>
                            <div class="footer-links">
                                <div class="footer-row">
                                    <ul class="align-items-center">
                                        <li class="li"><a class="single-link" href="my-account.html">我的账号</a>
                                        </li>
                                        <li class="li"><a class="single-link" href="cart.html">我的购物车</a></li>
                                        <li class="li"><a class="single-link" href="login.html">登录</a></li>
                                        <li class="li"><a class="single-link" href="wishlist.html">感兴趣的</a></li>
                                        <li class="li"><a class="single-link" href="checkout.html">结账</a></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- End single blog -->
                    <!-- Start single blog -->
                    <div class="col-md-6 col-lg-3" data-aos="fade-up" data-aos-delay="800">

                    </div>
                    <!-- End single blog -->
                </div>
            </div>
        </div>
        <div class="footer-bottom">
            <div class="container">
                <div class="row flex-sm-row-reverse">
                    <div class="col-md-6 text-right">
                        <div class="payment-link">
                            <img src="#" alt="">
                        </div>
                    </div>
                    <div class="col-md-6 text-left">
                        <p class="copy-text">Copyright &copy; 2021 韩顺平教育~</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Footer Area End -->
<script src="assets/js/vendor/vendor.min.js"></script>
<script src="assets/js/plugins/plugins.min.js"></script>
<!-- Main Js -->
<script src="assets/js/main.js"></script>
</body>
</html>